//
//  CQHttpTool.m
//  01-OC微博
//
//  Created by 陈乾 on 15/11/3.
//  Copyright © 2015年 陈乾. All rights reserved.
//   隔离网络框架

#import "CQHttpTool.h"
#import "AFNetworking.h"

@implementation CQHttpTool


+ (void)GET:(NSString *)URLString parameters:(id)parameters success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure {
    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    
    [manager GET:URLString parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
        //如果有success 这个block 就把数据回调回去
        if (success) {
            success(responseObject);
        }
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        if (failure) {
            failure(error);
        }
        
    }];
    
}



@end
